{extend name="default/base/base_seller" /}
{block name="seller_main"}


<div class="dssc-flow-layout">
    <div class="dssc-flow-container">
        <div class="title">
            <h3>{$Think.lang.refund_service}</h3>
        </div>
        <div id="saleRefundreturn">
            <div class="dssc-flow-step">
                <dl class="step-first current">
                    <dt>{$Think.lang.application_return}</dt>
                    <dd class="bg"></dd>
                </dl>
                <dl class="{if $return.seller_time > 0}current{/if}">
                    <dt>{$Think.lang.merchants_process_applications_returns}</dt>
                    <dd class="bg"> </dd>
                </dl>
                <dl class="{if $return.ship_time>0 || $return.return_type==1 }current{/if}">
                    <dt>{$Think.lang.buyers_return_goods_merchants}</dt>
                    <dd class="bg"> </dd>
                </dl>
                <dl class="{if $return.admin_time>0}current{/if}">
                    <dt>{$Think.lang.confirm_goods}</dt>
                    <dd class="bg"> </dd>
                </dl>
            </div>
            <div class="dssc-form-default">
                <h3>{$Think.lang.buyer_returns_refund_application}</h3>
                <dl>
                    <dt>{$Think.lang.refund_number}：</dt>
                    <dd>{$return.refund_sn} </dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.applicant_buyers}：</dt>
                    <dd>{$return.buyer_name}</dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.return_buyer_message}{$Think.lang.ds_colon}</dt>
                    <dd> {$return.reason_info} </dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.refund_amount}：</dt>
                    <dd>{$Think.lang.currency}{$return.refund_amount} </dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.return_order_return}{$Think.lang.ds_colon}</dt>
                    <dd>{if $return.return_type==2}{$return.goods_num}{else/}{$Think.lang.there_no}{/if}</dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.return_instructions}：</dt>
                    <dd> {$return.buyer_message} </dd>
                </dl>
                <dl>
                    <dt>{$Think.lang.credentials_upload}：</dt>
                    <dd>
                        {notempty name="pic_list"}
                        <ul class="dssc-evidence-pic">
                            {foreach name="pic_list" item="val" key="key" }
                            {notempty name="val"}
                            <li><a href="{$Think.UPLOAD_SITE_URL}/{$Think.ATTACH_PATH}/refund/{$val}" data-lightbox="lightbox-image"> <img class="show_image" src="{$Think.UPLOAD_SITE_URL}/{$Think.ATTACH_PATH}/refund/{$val}"></a></li>
                            {/notempty}
                            {/foreach}
                        </ul>
                        {/notempty}
                    </dd>
                </dl>
                <form id="post_form" method="post" action="{:url('Sellerreturn/edit',['return_id'=>$return.refund_id])}">
                    <h3>{$Think.lang.business_processing}</h3>
                    <dl>
                        <dt><i class="required">*</i>{$Think.lang.return_seller_confirm}{$Think.lang.ds_colon}</dt>
                        <dd>
                            <div>
                                <label class="mr20">
                                    <input type="radio" class="vm" name="seller_state" value="2" />
                                    {$Think.lang.agreed}</label>
                                <label>
                                    <input name="return_type" class="vm" type="checkbox" value="1" />
                                    {$Think.lang.jettison}</label>
                                <p class="hint">{$Think.lang.administrator_confirms_refund}</p>
                            </div>
                            <div class="mt10">
                                <label>
                                    <input type="radio" class="vm" name="seller_state" value="3" />
                                    {$Think.lang.refused}</label>
                            </div>
                            <span class="error"></span>
                        </dd>
                    </dl>
                    <dl>
                        <dt><i class="required">*</i>{$Think.lang.return_message}{$Think.lang.ds_colon}</dt>
                        <dd>
                            <textarea name="seller_message" rows="2" class="textarea w300"></textarea>
                            <span class="error"></span>
                            <p class="hint"> {$Think.lang.monitor_buyer_shipments}<br>
                            </p>
                        </dd>
                    </dl>
                    <div class="bottom">
                        <a class="submit" id="confirm_button">{$Think.lang.ds_ok}</a>
                    </div>
                </form>
            </div>
        </div>
    </div>
    {include file="default/seller/sellerrefund/seller_refund_right" /}
</div>
<link rel="stylesheet" href="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/css/lightbox.min.css">
<script src="{$Think.PLUGINS_SITE_ROOT}/js/jquery.lightbox/js/lightbox.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#confirm_button").click(function () {
            $("#post_form").submit();
        });
        $('#post_form').validate({
            errorPlacement: function (error, element) {
                error.appendTo(element.parentsUntil('dl').find('span.error'));
            },
            submitHandler: function (form) {
                ds_ajaxpost('post_form', 'url', "{:url('Sellerreturn/index',['lock'=>$return.order_lock])}");
            },
            rules: {
                seller_state: {
                    required: true
                },
                seller_message: {
                    required: true
                }
            },
            messages: {
                seller_state: {
                    required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.return_seller_confirm_null}'
                },
                seller_message: {
                    required: '<i class="iconfont">&#xe64c;</i>{$Think.lang.return_message_null}'
                }
            }
        });
    });
</script>




{/block}
